package com.bupt.consumer.controller;


import com.bupt.film.client.FilmInfoClient;
import com.bupt.film.entity.Film;
import com.bupt.film.entity.Hall;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
//@CrossOrigin
public class FilmInfoConsumerController implements FilmInfoClient {

    @Autowired
    private FilmInfoClient filmInfoClient;


    @Override
    public List<Hall> getHallsInfoList() {
        return filmInfoClient.getHallsInfoList();
    }

    @Override
    public String getHallsInfo() {
        return filmInfoClient.getHallsInfo();
    }

    @Override
    public Hall getOneHallInfo(String hallId) {
        return filmInfoClient.getOneHallInfo(hallId);
    }

    @Override
    public List<Film> getFilmsInfo() {
        return filmInfoClient.getFilmsInfo();
    }

    @Override
    public Film getOneFilmInfo(String filmId) {
        return filmInfoClient.getOneFilmInfo(filmId);
    }

    @Override
    public List<Film> getFilmsWithinTimeRange(String hallId, Date startTime, Date endTime) {
        return filmInfoClient.getFilmsWithinTimeRange(hallId, startTime, endTime);
    }

    @Override
    public Map<String, Object> getFilmShowDetail(String hallId, String filmId, Date showDate) {
        return filmInfoClient.getFilmShowDetail(hallId, filmId, showDate);
    }
}
